package go_tools

import "time"

func StartEndTime(t time.Time) (time.Time, time.Time) {

	start := DayStartTime(t)
	end := DayEndTime(t)

	return start, end
}

func DayStartTime(t time.Time) time.Time {

	timeStr := t.Format("2006-01-02")
	start, _ := time.Parse("2006-01-02", timeStr)

	return start
}

func DayEndTime(t time.Time) time.Time {

	timeStr := t.AddDate(0, 0, 1).Format("2006-01-02")
	end, _ := time.Parse("2006-01-02", timeStr)
	end.Add(-1)

	return end
}
